package com.zd.web.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zd.service.AdminChapterService;
import com.zd.service.impl.AdminChapterServiceImpl;

/**
 * Servlet implementation class chapterDeleteServlet
 */
@WebServlet("/chapterDeleteServlet")
public class chapterDeleteServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	AdminChapterService nl=new AdminChapterServiceImpl();
  
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		int chapterId=Integer.parseInt(request.getParameter("chapterId"));
		int num =nl.deleteChapter(chapterId);
		response.sendRedirect("chapter.jsp");
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}
